package BaseDatos;
import java.sql.*;

public class Coneccion {
	
	private static final String DSN = "jugadores";
	private static final String USU = "jugadores";
	private static final String PAS = "jugadores";
	private static final String SPS = "SELECT Name FROM sysobjects WHERE Type = 'P'";
	private Connection con;
	
    public static String getSPS() {
		return SPS;
	}

	public Connection getCon() {
		return con;
	}

	public void setCon(Connection con) {
		this.con = con;
	}

	public static void odbcDrivers() {
		try {
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		}
		catch( ClassNotFoundException e ) {
			e.printStackTrace();
		}    	
    }
  
    public void conectar(String us, String pass) {
		try {
			
			con = DriverManager.getConnection("jdbc:odbc:jugadores", us, pass);
		}
		catch( SQLException e ) {
			e.printStackTrace();
		} 
	}
    
    public void desconectar() {
		try {
			con.close();
		}
		catch( SQLException e ) {
			e.printStackTrace();
		}    
	}
}